<!--
 * @Descripttion: 
 * @Version: 
 * @Author: gaohj
 * @Date: 2023-01-11 10:50:06
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2023-01-11 10:58:15
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>第二页</title>
</head>
<body>
    <h1>我是第二页</h1>
    <a href="./three.html">点我跳转到第三页</a>
    <button onclick="mygo()">前进一页1</button>
    <button onclick="myforward()">前进一页2</button>

    <button onclick="myback()">后腿一页1</button>
    <button onclick="myback_2()">后腿一页2</button>


    <script>
        // 前进  forward()  go(1)
        // 后腿  back() go(-1)

        function mygo(){
            window.history.go(1);
        }
        function myforward(){
            window.history.forward();
        }

        function myback(){
            window.history.go(-1);
        }
        function myback_2(){
            window.history.back();
        }
    </script>
</body>
</html>